package day0423;

/**
 * @Author Stringzhua
 * @Date 2024/4/23 13:22
 * description:测试类
 */
public class Main {
    public static void main(String[] args) {
        Light light = new Light();
        LightOnCommand lightOnCommand = new LightOnCommand(light);
        LightOffCommand lightOffCommand = new LightOffCommand(light);
        RemoteControl remoteControl = new RemoteControl();

        remoteControl.addCommand("slot1", lightOnCommand);
        remoteControl.addCommand("slot2", lightOffCommand);
        remoteControl.pressButton("slot1");//开灯
        remoteControl.pressButton("slot2");//关灯
    }
}
